ghc: 9.6.6-debian-binary for powerpc64le, too#489139
ghc: 9.6.6-debian-binary for powerpc64le, too#489139nwf wants to merge 1 commit intoNixOS:masterfrom
Conversation
66385bc to
1b37e4b
Compare
| # No bindist, "borrowing" the GHC from Debian | ||
| useDebianBinaryOr = | ||
| pkg: | ||
| if lib.meta.availableOn stdenv.hostPlatform bb.packages.ghc966DebianBinary.ghc then |
There was a problem hiding this comment.
We allow targeting either ELF ABI version (ELFv1 or ELFv2) on glibc. The binary fetched from Debian is glibc ELFv1. lib.meta.availableOn does not care about the ELF ABI, hence the check for isAbiElfv1.
nix-instantiate --eval --strict --expr 'with import ./. { crossSystem = "powerpc64-unknown-linux-gnuabielfv2"; }; lib.meta.availableOn stdenv.hostPlatform haskell.compiler.ghc966DebianBinary'
true
The patchelf call to set the interpreter would link the ELFv1 binary to the ELFv2 interpreter, which will likely not be a functional combination.
There was a problem hiding this comment.
Ah. Rats; I'd hoped that could be nicely encapsulated. I guess I should add a predicate field to each of the ghcDebs entries and wire that up to the things availableOn looks at?
There was a problem hiding this comment.
For better or worse, the conditions should be written out in haskell-packages.nix. We don't want to evaluate anything from ghc966DebianBinary unless we are actually going to use it.
There was a problem hiding this comment.
Is such evaluation expensive?
ETA: tweaked the PR so that it asks the Debian ghc package from 9.6.6-debian-binary.nix directly rather than going through the gyrations of building up and evaluating packagesBuildBuild.haskell.ghc966DebianBinary.ghc .
1b37e4b to
c590cae
Compare
|
I've tried reworking the |
| --replace-fail powerpc64-linux-gnu-ld ld \ | ||
| --replace-fail powerpc64-linux-gnu-ar ar \ | ||
| --replace-fail powerpc64-linux-gnu-ranlib ranlib \ | ||
| --replace-fail ${stdenv.hostPlatform.system}-gnu-gcc gcc \ |
There was a problem hiding this comment.
better tie this to the selected attribute name.
There was a problem hiding this comment.
That is the selected attribute name? Do you want me to add a key to the attrsets in ghcDebs (like platforms) that can override this value?
c590cae to
274f2e0
Compare
| useDebianBinaryOr = | ||
| pkg: | ||
| if lib.meta.availableOn stdenv.hostPlatform ghc966DebianBinary then | ||
| bb.packages.ghc966DebianBinary | ||
| else | ||
| pkg; |
There was a problem hiding this comment.
This reads like "use debian by default, fallback to others if not available" - which is not what we want. I know it actually doesn't do it, because the platforms for the debian bindist and the regular bindists don't overlap, but still...
How about we do something like if availableOn hostPlatform pkg then pkg else if availableOn hostPlatform ghc966DebianBinary then ghc966DebianBinary? Aka only fallback to debian if not otherwise available.
There was a problem hiding this comment.
Other than that having to be availableOn hostPlatform pkg.ghc, which threw me for a moment, that seems like a good idea. :)
Build on NixOS#439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package. Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
274f2e0 to
5775639
Compare
Build on #439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package.
Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.